package ui20131001.service
{
	import mx.controls.Alert;
	
	import ui20131001.helper.IndividualUsersService;

	/**
	 * @author : LIMIN
	 * @time : 2013-10-21 上午9:43:14
	 * 
	 * @remarks :获取设备列表
	 */
	
	public class IndiGetMemberDeviceCmd extends InterfaceBaseCommand
	{
		public function IndiGetMemberDeviceCmd(callback:Function, params:Object=null)
		{
			super(callback, params);
		}
		
		override public function execute():void
		{
			IndividualUsersService.getMemberDevice(onResponse);
		}
		
		override protected function onResponse(data:Object):void
		{
			super.onResponse(data);
			if(data.status==1)
			{
				onSuccess(data);
			}else
			{
				var errorStr:String = "";
				switch(data.status)
				{
					case -1000:
						errorStr = "尚未登录用户，请登录";
						break;
					case -1:
						errorStr = "设备类型未知";
						break;
					case 0:
						errorStr = "无数据";
						break;
					default:
						errorStr = "error: "+data.status;
				}
				Alert.show(errorStr,"数据获取失败");
			}
		}
		
	}
}